package com.danbay.cloud.device.mapper;


import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.danbay.cloud.device.entity.EnergyConsumption;

/**
 * Created by SJG on 2017/10/17.
 */
public interface EnergyConsumptionMapper extends BaseMapper<EnergyConsumption> {

    /**
     * 取24小时内最近一条能耗记录
     * @param consumption
     * @return
     */
    EnergyConsumption get24HourLastEnergyConsumption(EnergyConsumption consumption);

    /**
     * 取设备本月1号到当前时间的能耗总和
     * @param consumption
     * @return
     */
    Double getCurrMonthConsumptionSum(EnergyConsumption consumption);
}
